package com.lwl.controller.sas;

import com.lwl.entity.LayData;
import com.lwl.entity.sas.TSasRecordDetail;
import com.lwl.service.sas.TSasRecordDetailService;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * (TSasRecordDetail)表控制层
 *
 * @author Lei
 * @since 2022-11-07 21:35:36
 */
@RestController
@RequestMapping("tSasRecordDetail")
public class TSasRecordDetailController {
    /**
     * 服务对象
     */
    @Autowired
    private TSasRecordDetailService tSasRecordDetailService;

    /**
     *  将前端页面传过来的题目答案信息转化为Javabean的形式，然后存储到做题记录中
     */
    // @RequestBody 把json字符串转化为对象，只能放在形参前面
    @PostMapping("insertDetail")
    public LayData insertDetail(@RequestBody List<TSasRecordDetail> tSasRecordDetails){
//        System.out.println("tSasRecordDetails^^^^^^^^^^^^^^^^^^^^^^^^^^^ = " + tSasRecordDetails);
        boolean status = tSasRecordDetailService.insertDetail(tSasRecordDetails);
        return new LayData(status);
    }


}
